<?php

/**
 * Video form.
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class VideoForm extends BaseVideoForm
{
  public function configure()
  {
      unset($this['id'],$this['created_at'],$this['is_featured']);
      
      # WIDGETS
      $choices = Doctrine::getTable('BbSeason')->fetcharray();
      $this->widgetSchema['season_id']   = new sfWidgetFormChoice(array('choices'=>$choices), array('style'=>'width:400px;height:24px;', 'onchange'=>'loadObjects();'));
    	$types = myConstants::getGalleryTypes();
    	$this->widgetSchema['object_type'] = new sfWidgetFormChoice(array('choices'=>$types), array('style'=>'width:400px;height:24px;', 'onchange'=>'loadObjects();'));
      $this->widgetSchema['title']       = new sfWidgetFormInputText(array(), array('style'=>'width:400px;'));
      $this->widgetSchema['embed'] = new sfWidgetFormTextarea(array(), array('style'=>'width:400px;'));
      
      $this->setDefault('object_type', $this->getOption('objectType'));
      
      
      # VALIDATORS
      $this->validatorSchema['season_id']   = new sfValidatorPass();
      $this->validatorSchema['object_type'] = new sfValidatorPass();
      $this->validatorSchema['object_id']   = new sfValidatorPass();
    	$this->validatorSchema['title']       = new sfValidatorString();
    	$this->validatorSchema['embed']       = new sfValidatorString();
      
      // LABELS
      $this->widgetSchema->setLabel('season_id', 'Улирал *');
      $this->widgetSchema->setLabel('object_type', 'Төрөл *');
      $this->widgetSchema->setLabel('title', 'Гарчиг *');
      $this->widgetSchema->setLabel('embed', 'Видео *');
      
      $this->widgetSchema->setHelp('embed', 'youtube embed link like: http://www.youtube.com/embed/5rx76tcWChI');
  }

}
